]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
ibusCandidatePopup: Feed OSK suggestions from ibus panel candidates
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 6 Dec 2017 13:44:16 +0000 (14:44 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Mon, 5 Feb 2018 16:46:57 +0000 (17:46 +0100)
We don't currently hide the ibus completion panel, and this is done from
within the popup that we are meant to hide itself, so thoroughly sucks.

js/ui/ibusCandidatePopup.js

index 1571224e68f3b64ce48bc74018edd70ad4433734..43626af87c6826498dd2b344684aba37c4bcd145 100644 (file)
@@ -253,10 +253,18 @@ var CandidatePopup = new Lang.Class({
                                  for (let i = 0; indexLabel = lookupTable.get_label(i); ++i)
                                       indexes.push(indexLabel.get_text());
 
+                                 Main.keyboard.resetSuggestions();
+
                                  let candidates = [];
-                                 for (let i = startIndex; i < endIndex; ++i)
+                                 for (let i = startIndex; i < endIndex; ++i) {
                                      candidates.push(lookupTable.get_candidate(i).get_text());
 
+                                     Main.keyboard.addSuggestion(lookupTable.get_candidate(i).get_text(), Lang.bind(this, function() {
+                                         let index = i;
+                                         this._panelService.candidate_clicked(index, 1, 0);
+                                     }));
+                                 }
+
                                  this._candidateArea.setCandidates(indexes,
                                                                    candidates,
                                                                    cursorPos % pageSize,
@@ -277,6 +285,7 @@ var CandidatePopup = new Lang.Class({
         panelService.connect('focus-out',
                              Lang.bind(this, function(ps) {
                                  this._boxPointer.hide(BoxPointer.PopupAnimation.NONE);
+                                 Main.keyboard.resetSuggestions();
                              }));
     },
 
@@ -287,9 +296,10 @@ var CandidatePopup = new Lang.Class({
     },
 
     _updateVisibility: function() {
-        let isVisible = (this._preeditText.visible ||
-                         this._auxText.visible ||
-                         this._candidateArea.actor.visible);
+        let isVisible = (!Main.keyboard.visible &&
+                         (this._preeditText.visible ||
+                          this._auxText.visible ||
+                          this._candidateArea.actor.visible));
 
         if (isVisible) {
             this._boxPointer.setPosition(Main.layoutManager.dummyCursor, 0);